<!--
 * @Author: your name
 * @Date: 2020-10-14 18:09:12
 * @LastEditTime: 2021-01-25 18:12:56
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \solaxcloud\src\components\LangSelect.vue
-->
<template>
    <el-dropdown  @command="handleCommand" class="language" size="small">
        <span class="el-dropdown-link">
            <i class="iconfont icon-global" inner></i>{{$t('login.languageToggle')}}<i class="el-icon-arrow-down el-icon--right"></i>
        </span>
        <el-dropdown-menu slot="dropdown">
            <el-dropdown-item command="zh_CN">简体中文</el-dropdown-item>
            <el-dropdown-item command="en_US">English</el-dropdown-item>
            <el-dropdown-item command="de_DE">Deutsch</el-dropdown-item>
            <el-dropdown-item command="it_IT">Italiano</el-dropdown-item>
            <el-dropdown-item command="fr_FR">Français</el-dropdown-item>
            <el-dropdown-item command="nl_NL">Nederlands</el-dropdown-item>
            <el-dropdown-item command="ru_RU">русский</el-dropdown-item>
            <el-dropdown-item command="es_ES">Español</el-dropdown-item>
            <el-dropdown-item command="sk_SK">Slovenčina</el-dropdown-item>
            <el-dropdown-item command="pt_BR">Português</el-dropdown-item>
            <el-dropdown-item command="cs_CZ">Čeština</el-dropdown-item>
            <el-dropdown-item command="pl_PL">Polski</el-dropdown-item>
            <el-dropdown-item command="ja_JP">日本語</el-dropdown-item>
            <el-dropdown-item command="ro_RO">Română</el-dropdown-item>
            <el-dropdown-item command="ka_GE">ქართული</el-dropdown-item>
            <el-dropdown-item command="fi_FI">Suomi</el-dropdown-item>
            <el-dropdown-item command="tr_TR">Türkçe</el-dropdown-item>
            <el-dropdown-item command="bg_BG">България</el-dropdown-item>
        </el-dropdown-menu>
    </el-dropdown>
</template>
<script>
export default {
    name:'LangSelect',
    methods:{
        handleCommand(lang){
            localStorage.setItem('lang',lang);
            localStorage.setItem('lan',lang);
            location.reload();
        }
    }
}
</script>